package vcsn;

public class Config {
	public enum SyncStatus{OFFLINE, ONLINE, SYNC};
	public static SyncStatus status = SyncStatus.OFFLINE;
	public static class HeaderType{
		public static final int PEER = 0;
		public static final int COMMITPATCH = 1;
		public static final int FILELOCK = 2;
		public static final int ACKNOWLEDGMENT = 3;
		public static final int DIFFPATCH = 4;
		public static final int DIFFPATCHREQUEST = 5;
		public static final int ONLINESYNCREQUEST = 6;
	}
	
	public static class AcknowledgmentType{
		public static final int NOTYPE = -1;
		public static final int PEER = 0;
//		public static final int DIFFPATCHCONFLICTRESOLVED = 1;
		public static final int POSTPEERSYNC = 2;
		public static final int ONLINESYNCRESPONSE = 3;
		public static final int POSTPATCHSYNC = 4;
		public static final int HashHeadSYNC = 5;
	}
	// File title / directory notation configuration
	public static final String peerFile = ".gitpeer";
	public static final String lockFile = ".filelock";
	public static final String relaitonMapFile = "RelationMap.xml";
	public static final String localClockFile = ".localClock";
	public static final String incomingClockFile = ".incomingClock";
	public static final String lastAppliedCommitHashListFile = ".commitHashList";
	public static final String incomingCommitPatchListFile = ".patchMetaDataList";
	public static final String gitConfigFile = ".gitconfig";
	public static final String tempFilePrefix = "temp_%s";
	public static final String tempDirectory = "temp";
	public static final String tempPatchFilePrefix = "tmp_ptch_%s";
	public static final String tempRelationMapDiffPatchFilePrefix = "tmp_rdiff_%s";
	public static final String homeDirectoryNotation = "user.home";
	
	public static final String equal = "=";
	public static final String separator = ";";
	public static final String setOpen = "(";
	public static final String setClose = ")";
	public static final String superSetOpen = "{";
	public static final String superSetClose = "}";
	public static final String keyConnector = "_";
	
	// Socket configuration
	public static final int bufferSize = 8192;
	public static final String charSet = "UTF-8";
	public static final String localHost = "127.0.0.1";

	// GIT configuration prefix
	public static final String emailPrefix = "email = ";
	public static final String namePrefix = "name = ";
	
	public static final String HEADHash = "HEAD";
	public static final String OriginMasterHash = "refs/remotes/origin/master";
	
	public static final String userSection = "user";
	public static final String remoteSection = "remote";
	public static final String branchSection = "branch";
	public static final String originSubSection = "origin";
	public static final String masterSubSection = "master";
	public static final String nameKey = "name";
	public static final String emailKey = "email";
	public static final String urlKey = "url";
	public static final String fetchKey = "fetch";
	public static final String remoteKey = "remote";
	public static final String mergeKey = "merge";
	
	// Identities under this heading is to define constants used in commit patch.
	// commit patch properties id configuration
	public static final String propertyIDAuthor = "author";
	public static final String propertyIDPatchHash = "patchHash";
	public static final String propertyIDPatchPath = "patchPath";
	public static final String propertyIDRelationDiffPath = "relationDiffPath";
	public static final String propertyIDEstimatedConflictCount = "estimatedConflictCount";
	public static final String propertyIDEstimatedRefactorCount = "estimatedRefacytorCount";
	public static final String propertyIDBuildDate = "buildDate";
	public static final String propertyIDSenderAddr = "senderAddr";
	
	// conflicts properties id inside commit patch configuration
	public static final String propertyConflictType = "cType";
	public static final String propertyConflictTypeRename = "rename";
	public static final String propertyConflictTypeAddComment = "addComment";
	public static final String propertyConflictTypeAddCast = "addCast";
	public static final String propertyConflictTypeRemoveKeyword = "removeKeyword";
	
	public static final String propertyLocatedPosition = "locatedPosition";
	public static final String propertyLocatedFile = "locatedFile";
	public static final String propertyConflictPrefix = "conflict";
	
	public static final String propertyOriginIdentifier = "originIdentifier";
	public static final String propertyModifiedIdentifier = "modifiedIdentifier";
	
	public static final String propertyCommentString = "commentString";
	
	public static final String propertyCastTotype = "cast";
	public static final String propertyKeyword = "keyword";
	public static final String propertyFirstParameterStartingPosition = "firstParameterStartingPosition";
	public static final String propertyLastParameterEndingPosition = "lastParameterEndingPosition";
	
	// commit patch properties id configuration to distinguish various commits in the same or different project 
	public static final String propertyCommitPrefix = "commit";
	public static final String propertyProjectIdentity = "project";
	public static final String propertyHashPrefix = "hash";
	public static final String propertyClockPrefix = "clock";
	
	// DateTime String
	public static final String FormattedDateTimeString = "yyyy/MM/dd HH:mm";
	public static final String FormattedDateTimeFileName = "yyyy_MM_dd_HH_mm_ss.SSS";
	
	// pre-defined commit Message
	public static final String patchSyncMsg = "Synchronization Commit. Reserved commit for roll back by vcsn.";
	public static final String patchPreAppliedMsg = "Incoming Commit : %s. Reserved commit for roll back by vcsn.";
	public static final String patchAppliedMsg = "Incoming Commit : %s. Merge by vcsn.";
	public static final String patchConflictsResolvedMsg = "Incoming Commit : %s is resolved successfully by vcsn.";
	public static final String peerFileUpdateMsg = "Modify peer list.";
	public static final String peerFileAppliedMsg = "Modify peer list from incoming source.";
	public static final String lockFileUpdateMsg = "lock process executed by local source.";
	public static final String LockfileAppliedMsg = "lock process applied from incoming source.";
	
	public static final String InlineCommentOpen = "/*";
	public static final String InlineCommentClose = "*/";
	
	public static final String patchDeletion = "/dev/null";
	
	public static final String syncStatusMsg = "Sync successful! You are now ";
	public static final String syncDialogTitle = "Synchronize status";
	public static final String onlineStatusMsg = "Your current status is ";
	public static final String onlineDialogTitle = "Current Status";
	
//	public static final String remoteUri = "https://freemail0062:Ts3yP8Kp8DY3@code.google.com/p/demoroject2/";
}
